import { ApiProperty } from '@nestjs/swagger'
import { IsNotEmpty, IsOptional, Length } from 'class-validator'

export class orderScoreDto {
  @ApiProperty({ description: '', required: true, default: '' })
  @IsNotEmpty({ message: '订单ID不能为空' })
  order_id: number // 关联的订单ID

  @ApiProperty({ description: '评分(1-5分)', required: true, default: '' })
  @IsNotEmpty({ message: '评分不能为空' })
  score: number

  @ApiProperty({ description: '评价内容', required: false, default: '' })
  @IsOptional()
  @Length(0, 500, { message: '评价内容不超过500字' })
  comment?: string

  @ApiProperty({ description: '评价图片', required: false, default: '' })
  @IsOptional()
  photo_url?: string
}